package com.nsoft.remoteserver;

import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JTextField;

import com.nsoft.remoteserver.utils.Constant;

public class SettingsPanel extends JPanel {

	private static final long serialVersionUID = 1L;
	private JTextField hostText;
	
	public SettingsPanel(){
		JPanel mainPanel=new JPanel();
		mainPanel.setBorder(BorderFactory.
				createTitledBorder(
					Constant.ui.TAB_SETTINGS_SVR_GROUP));
		mainPanel.setSize(300,100);
		
		hostText=new JTextField(20);
		JButton checkBtn=new JButton(
				Constant.ui.TAB_SETTINGS_APPLY);
		
		checkBtn.addActionListener(new ActionListener(){
			@Override
			public void actionPerformed(ActionEvent e){
				openConnection();
			}
		});
		
		mainPanel.add(hostText);
		mainPanel.add(checkBtn);
		
		this.add(mainPanel,BorderLayout.CENTER);
	}
	
	private void openConnection(){
		String hostName=hostText.getText();

	}
}
